<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;
use App\Models\Fangattr;

class FangAttrController extends BaseController
{
    private $_attr = [
        //租期方式
        'fang_rent_type' => 1,
        //房源朝向
        'fang_direction' => 5,
        //租赁方式
        'fang_rent_class' => 8,
        //租房小组
        'field_group' => 15
    ];
    //查询属性列表
    public function fangattr(Request $request){
        $arr = [];
        foreach($this->_attr as $key => $val){
               $arr[$key] = Fangattr::where('pid',$val)->get(['id','name']);
        }
        return $arr;
    }
}
